﻿package mortal.component.gLinkText
{
    import com.mui.controls.*;
    import com.mui.manager.*;
    import extend.language.*;
    import flash.events.*;
    import mortal.game.cache.*;
    import mortal.game.events.*;
    import mortal.game.mvc.*;
    import mortal.game.resource.*;
    import mortal.game.view.common.*;
    import mortal.mvc.core.*;

    public class FlyBoot extends ToolTipSprite
    {
        private var _btnFlyBoot:GLoadedButton;
        private var _myData:GLinkTextData;

        public function FlyBoot()
        {
            return;
        }// end function

        public function set gLinkTextData(param1:GLinkTextData) : void
        {
            this._myData = param1;
            return;
        }// end function

        override public function get width() : Number
        {
            return 16;
        }// end function

        override public function get height() : Number
        {
            return 18;
        }// end function

        override protected function createDisposedChildrenImpl() : void
        {
            super.createDisposedChildrenImpl();
            this.buttonMode = true;
            this._btnFlyBoot = UIFactory.gLoadedButton(ImagesConst.MapBtnFlyBoot_upSkin, 2, 2, 16, 18, this);
            this._btnFlyBoot.mouseChildren = false;
            this._btnFlyBoot.mouseEnabled = false;
            this.mouseEnabled = true;
            this.mouseChildren = false;
            this.configEventListener(MouseEvent.CLICK, this.flyBootHandler);
            return;
        }// end function

        override protected function disposeImpl(param1:Boolean = true) : void
        {
            super.disposeImpl(param1);
            this._btnFlyBoot.mouseChildren = true;
            this._btnFlyBoot.mouseEnabled = true;
            this._btnFlyBoot.dispose(param1);
            this._btnFlyBoot = null;
            this._myData = null;
            return;
        }// end function

        private function flyBootHandler(event:MouseEvent) : void
        {
            if (this._myData == null)
            {
                return;
            }
            Dispatcher.dispatchEvent(new DataEvent(EventName.FlyBoot_GLinkText, this._myData));
            return;
        }// end function

        override public function get toolTipData()
        {
            var _loc_1:* = Cache.instance.vip.freeFlyBootTimes;
            if (_loc_1 == -1)
            {
                return Language.getString(20367);
            }
            return Language.getStringByParam(20368, _loc_1);
        }// end function

    }
}
